```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>n8n 安装指南 | 专业自动化平台部署教程</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', 'Noto Serif SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            line-height: 1.6;
            color: #333;
            background-color: #f9fafb;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .highlight-box {
            border-left: 4px solid #6e8efb;
            background-color: rgba(110, 142, 251, 0.05);
        }
        .step-number {
            width: 32px;
            height: 32px;
            background-color: #6e8efb;
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            font-weight: bold;
            margin-right: 12px;
            flex-shrink: 0;
        }
        .tab-active {
            border-bottom: 3px solid #6e8efb;
            color: #6e8efb;
            font-weight: 500;
        }
        .code-block {
            font-family: 'Courier New', Courier, monospace;
            background-color: #2d2d2d;
            color: #f8f8f2;
            border-radius: 8px;
            position: relative;
        }
        .copy-btn {
            position: absolute;
            right: 8px;
            top: 8px;
            background-color: rgba(255,255,255,0.1);
            border: none;
            color: white;
            padding: 4px 8px;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.2s;
        }
        .copy-btn:hover {
            background-color: rgba(255,255,255,0.2);
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <div class="hero-gradient text-white py-20 px-4 sm:px-6 lg:px-8">
        <div class="max-w-5xl mx-auto text-center">
            <h1 class="text-4xl md:text-5xl font-bold mb-6 leading-tight">
                n8n 自动化平台安装指南
            </h1>
            <p class="text-xl md:text-2xl opacity-90 mb-8 max-w-3xl mx-auto">
                专业、简洁的部署教程，助您快速搭建强大的工作流自动化平台
            </p>
            <div class="flex flex-wrap justify-center gap-4">
                <a href="#cloud" class="bg-white text-indigo-600 hover:bg-indigo-50 px-6 py-3 rounded-lg font-medium transition duration-300">
                    <i class="fas fa-cloud mr-2"></i>云版本
                </a>
                <a href="#self-hosted" class="bg-indigo-700 hover:bg-indigo-800 text-white px-6 py-3 rounded-lg font-medium transition duration-300">
                    <i class="fas fa-server mr-2"></i>自托管版
                </a>
            </div>
        </div>
    </div>

    <!-- Main Content -->
    <div class="max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
        <!-- Introduction Section -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-6 text-gray-800 border-b pb-2">准备工作</h2>
            <p class="text-gray-700 mb-6">
                在开始安装之前，您需要了解 n8n 的两种主要部署方式，选择最适合您的需求的方式。
            </p>
            
            <div class="grid md:grid-cols-2 gap-8 mb-12">
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-blue-100 p-3 rounded-lg">
                            <i class="fas fa-cloud text-blue-600 text-2xl"></i>
                        </div>
                        <h3 class="text-xl font-semibold ml-4 text-gray-800">n8n Cloud</h3>
                    </div>
                    <ul class="text-gray-700 space-y-2">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span>无需安装，注册即可使用</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span>适合不想管理服务器的用户</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span>提供免费试用和付费计划</span>
                        </li>
                    </ul>
                </div>
                
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <div class="flex items-center mb-4">
                        <div class="bg-purple-100 p-3 rounded-lg">
                            <i class="fas fa-server text-purple-600 text-2xl"></i>
                        </div>
                        <h3 class="text-xl font-semibold ml-4 text-gray-800">自托管社区版</h3>
                    </div>
                    <ul class="text-gray-700 space-y-2">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span>免费开源，完全控制</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span>适合有一定技术能力的用户</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span>可自定义配置和数据管理</span>
                        </li>
                    </ul>
                </div>
            </div>

            <div class="highlight-box p-6 rounded-lg mb-8">
                <div class="flex items-start">
                    <i class="fas fa-info-circle text-blue-500 text-xl mr-3 mt-1"></i>
                    <div>
                        <h4 class="font-semibold text-gray-800 mb-2">安装前准备</h4>
                        <ul class="list-disc pl-5 text-gray-700 space-y-1">
                            <li><strong>n8n Cloud</strong>：仅需浏览器和网络连接</li>
                            <li><strong>自托管版</strong>：需要服务器管理知识（Docker或Node.js），以及一台运行Windows、Mac或Linux的电脑或云服务器</li>
                        </ul>
                    </div>
                </div>
            </div>
        </section>

        <!-- Cloud Installation Section -->
        <section id="cloud" class="mb-16">
            <h2 class="text-3xl font-bold mb-6 text-gray-800 border-b pb-2">
                <i class="fas fa-cloud text-blue-500 mr-3"></i>安装方式一：n8n Cloud
            </h2>
            <p class="text-gray-700 mb-8">
                n8n Cloud 是最简单的使用方式，无需本地安装，适合新手快速上手。按照以下步骤开始使用：
            </p>

            <div class="space-y-6">
                <div class="flex items-start">
                    <div class="step-number">1</div>
                    <div>
                        <h3 class="text-xl font-semibold text-gray-800 mb-2">注册账户</h3>
                        <ul class="text-gray-700 space-y-2">
                            <li>访问 <a href="https://n8n.io/" class="text-blue-600 hover:underline" target="_blank">n8n 官方网站</a> 或直接前往 <a href="https://app.n8n.cloud/" class="text-blue-600 hover:underline" target="_blank">n8n Cloud</a></li>
                            <li>点击"Sign Up"或"Try for Free"注册一个免费试用账户</li>
                            <li>填写邮箱地址并设置密码，或者使用 Google 账户登录</li>
                            <li>注册后，您会收到一封确认邮件，点击链接激活账户</li>
                        </ul>
                    </div>
                </div>

                <div class="flex items-start">
                    <div class="step-number">2</div>
                    <div>
                        <h3 class="text-xl font-semibold text-gray-800 mb-2">开始使用</h3>
                        <ul class="text-gray-700 space-y-2">
                            <li>登录后，您将进入 n8n 的在线工作台</li>
                            <li>无需额外配置，即可开始创建工作流</li>
                            <li>免费试用版提供有限的功能和使用配额，足够用于测试和学习</li>
                        </ul>
                        <div class="mt-4">
                            <img src="https://cdn.nlark.com/yuque/0/2025/png/21449790/1753608919321-155cb548-7ab8-45fc-a1b5-e5b650f08f8c.png" alt="n8n Cloud 界面" class="rounded-lg shadow-md border border-gray-200 w-full max-w-3xl">
                        </div>
                    </div>
                </div>

                <div class="flex items-start">
                    <div class="step-number">3</div>
                    <div>
                        <h3 class="text-xl font-semibold text-gray-800 mb-2">升级计划（可选）</h3>
                        <p class="text-gray-700 mb-2">
                            如果需要更多功能或更高的使用配额，可在 n8n 官网查看付费计划详情：<br>
                            <a href="https://n8n.io/pricing" class="text-blue-600 hover:underline" target="_blank">https://n8n.io/pricing</a>
                        </p>
                    </div>
                </div>
            </div>
        </section>

        <!-- Self-Hosted Installation Section -->
        <section id="self-hosted" class="mb-16">
            <h2 class="text-3xl font-bold mb-6 text-gray-800 border-b pb-2">
                <i class="fas fa-server text-purple-500 mr-3"></i>安装方式二：自托管社区版
            </h2>
            <p class="text-gray-700 mb-6">
                自托管社区版是免费的，适合希望完全控制 n8n 实例的用户。以下是通过 Docker 安装的步骤（推荐方式），因为它简单且跨平台支持良好。
            </p>

            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="flex border-b">
                    <button class="px-6 py-3 font-medium text-gray-700 tab-active">Docker 安装</button>
                    <button class="px-6 py-3 font-medium text-gray-500 hover:text-gray-700">npm 安装</button>
                </div>
                <div class="p-6">
                    <h3 class="text-xl font-semibold text-gray-800 mb-4">环境要求</h3>
                    <ul class="text-gray-700 space-y-2 mb-6">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span><strong>操作系统</strong>：Windows、Mac 或 Linux</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span><strong>Docker</strong>：确保已安装 Docker Desktop（Windows/Mac）或 Docker Engine 和 Docker Compose（Linux）</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span><strong>硬件</strong>：至少 1GB 内存和 2GB 磁盘空间，建议 2GB 内存以获得更好性能</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span><strong>网络</strong>：如果需要外部触发（如 Webhook），确保服务器可通过公网访问</span>
                        </li>
                    </ul>

                    <h3 class="text-xl font-semibold text-gray-800 mb-4">安装步骤</h3>
                    
                    <div class="space-y-6">
                        <div class="flex items-start">
                            <div class="step-number">1</div>
                            <div>
                                <h4 class="text-lg font-semibold text-gray-800 mb-2">安装 Docker</h4>
                                <p class="text-gray-700 mb-2">
                                    <strong>Windows/Mac</strong>：下载并安装 <a href="https://www.docker.com/products/docker-desktop/" class="text-blue-600 hover:underline" target="_blank">Docker Desktop</a>
                                </p>
                                <p class="text-gray-700 mb-3">安装完成后，运行以下命令验证：</p>
                                <div class="code-block p-4 mb-4 relative">
                                    <button class="copy-btn" onclick="copyCode(this)">
                                        <i class="fas fa-copy"></i>
                                    </button>
                                    <pre class="overflow-x-auto"><code>docker --version
docker-compose --version</code></pre>
                                </div>
                            </div>
                        </div>

                        <div class="flex items-start">
                            <div class="step-number">2</div>
                            <div>
                                <h4 class="text-lg font-semibold text-gray-800 mb-2">拉取 n8n 镜像并启动</h4>
                                <p class="text-gray-700 mb-3">打开终端，运行以下命令启动 n8n 容器：</p>
                                <div class="code-block p-4 mb-4 relative">
                                    <button class="copy-btn" onclick="copyCode(this)">
                                        <i class="fas fa-copy"></i>
                                    </button>
                                    <pre class="overflow-x-auto"><code>docker run -it --rm --name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n n8nio/n8n</code></pre>
                                </div>
                                <div class="highlight-box p-4 rounded-lg">
                                    <h5 class="font-medium text-gray-800 mb-2">参数说明：</h5>
                                    <ul class="text-gray-700 space-y-1">
                                        <li><code>-p 5678:5678</code>：将 n8n 的默认端口 5678 映射到本地</li>
                                        <li><code>-v n8n_data:/home/node/.n8n</code>：创建持久化卷存储工作流、凭据和执行历史</li>
                                        <li><code>n8nio/n8n</code>：官方 n8n Docker 镜像</li>
                                    </ul>
                                </div>
                            </div>
                        </div>

                        <div class="flex items-start">
                            <div class="step-number">3</div>
                            <div>
                                <h4 class="text-lg font-semibold text-gray-800 mb-2">访问 n8n</h4>
                                <ul class="text-gray-700 space-y-2">
                                    <li>打开浏览器，访问 <code>http://localhost:5678</code></li>
                                    <li>首次访问时，n8n 会引导您设置管理员账户（用户名和密码）</li>
                                    <li>登录后即可开始创建工作流</li>
                                </ul>
                            </div>
                        </div>

                        <div class="flex items-start">
                            <div class="step-number">4</div>
                            <div>
                                <h4 class="text-lg font-semibold text-gray-800 mb-2">（可选）使用 PostgreSQL 替代 SQLite</h4>
                                <p class="text-gray-700 mb-3">默认情况下，n8n 使用 SQLite 存储数据。如果需要更高的性能，可以配置 PostgreSQL：</p>
                                <ul class="text-gray-700 mb-3 space-y-1">
                                    <li>安装 PostgreSQL（参考 <a href="https://www.postgresql.org/download/" class="text-blue-600 hover:underline" target="_blank">https://www.postgresql.org/download/</a>）</li>
                                    <li>修改 n8n 的环境变量，在 Docker 运行命令中添加：</li>
                                </ul>
                                <div class="code-block p-4 mb-4 relative">
                                    <button class="copy-btn" onclick="copyCode(this)">
                                        <i class="fas fa-copy"></i>
                                    </button>
                                    <pre class="overflow-x-auto"><code>-e DB_TYPE=postgresdb -e DB_POSTGRESDB_HOST=&lt;your_postgres_host&gt; -e DB_POSTGRESDB_DATABASE=&lt;your_database&gt; -e DB_POSTGRESDB_USER=&lt;your_user&gt; -e DB_POSTGRESDB_PASSWORD=&lt;your_password&gt;</code></pre>
                                </div>
                                <p class="text-gray-700 mb-3">示例完整命令：</p>
                                <div class="code-block p-4 mb-4 relative">
                                    <button class="copy-btn" onclick="copyCode(this)">
                                        <i class="fas fa-copy"></i>
                                    </button>
                                    <pre class="overflow-x-auto"><code>docker run -it --rm --name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n -e DB_TYPE=postgresdb -e DB_POSTGRESDB_HOST=localhost -e DB_POSTGRESDB_DATABASE=n8n -e DB_POSTGRESDB_USER=admin -e DB_POSTGRESDB_PASSWORD=yourpassword n8nio/n8n</code></pre>
                                </div>
                            </div>
                        </div>

                        <div class="flex items-start">
                            <div class="step-number">5</div>
                            <div>
                                <h4 class="text-lg font-semibold text-gray-800 mb-2">激活社区版许可证</h4>
                                <p class="text-gray-700 mb-2">社区版是免费的，但需要激活许可证：</p>
                                <ul class="text-gray-700 space-y-2">
                                    <li>登录 n8n 后，点击左下角的"三点"图标 > "Settings" > "Usage and Plan"</li>
                                    <li>点击"Unlock"，输入您的邮箱地址，点击"Send me a free license key"</li>
                                    <li>检查邮箱，点击收到的许可证链接或手动输入激活密钥</li>
                                    <li>激活后，您的社区版许可证永不过期，但功能受限（例如仅保留 24 小时的工作流历史）</li>
                                </ul>
                            </div>
                        </div>

                        <div class="flex items-start">
                            <div class="step-number">6</div>
                            <div>
                                <h4 class="text-lg font-semibold text-gray-800 mb-2">（可选）使用 Docker Compose</h4>
                                <p class="text-gray-700 mb-3">为更稳定的生产环境，推荐使用 Docker Compose。创建一个 <code>docker-compose.yml</code> 文件：</p>
                                <div class="code-block p-4 mb-4 relative">
                                    <button class="copy-btn" onclick="copyCode(this)">
                                        <i class="fas fa-copy"></i>
                                    </button>
                                    <pre class="overflow-x-auto"><code>version: "3"
services:
  n8n:
    image: n8nio/n8n
    ports:
      - "5678:5678"
    volumes:
      - n8n_data:/home/node/.n8n
    environment:
      - N8N_HOST=localhost
      - N8N_PORT=5678
volumes:
  n8n_data:</code></pre>
                                </div>
                                <p class="text-gray-700 mb-3">保存后，运行：</p>
                                <div class="code-block p-4 mb-4 relative">
                                    <button class="copy-btn" onclick="copyCode(this)">
                                        <i class="fas fa-copy"></i>
                                    </button>
                                    <pre class="overflow-x-auto"><code>docker-compose up -d</code></pre>
                                </div>
                                <p class="text-gray-700">这将启动 n8n，并在容器停止后保留数据。</p>
                            </div>
                        </div>

                        <div class="flex items-start">
                            <div class="step-number">7</div>
                            <div>
                                <h4 class="text-lg font-semibold text-gray-800 mb-2">更新 n8n</h4>
                                <p class="text-gray-700 mb-2">n8n 每周发布新版本，建议定期更新：</p>
                                <ul class="text-gray-700 space-y-2">
                                    <li>使用 Docker Desktop，在"Images"选项卡中选择 n8n 镜像，点击"Pull"拉取最新版本</li>
                                    <li>或者在终端运行：</li>
                                </ul>
                                <div class="code-block p-4 mt-2 relative">
                                    <button class="copy-btn" onclick="copyCode(this)">
                                        <i class="fas fa-copy"></i>
                                    </button>
                                    <pre class="overflow-x-auto"><code>docker pull n8nio/n8n
docker stop n8n
docker run -it --rm --name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n n8nio/n8n</code></pre>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Deployment Comparison -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-6 text-gray-800 border-b pb-2">
                <i class="fas fa-balance-scale text-gray-600 mr-3"></i>部署方式对比
            </h2>
            
            <div class="bg-white rounded-xl shadow-md overflow-hidden">
                <div class="overflow-x-auto">
                    <table class="min-w-full divide-y divide-gray-200">
                        <thead class="bg-gray-50">
                            <tr>
                                <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">比较项</th>
                                <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">n8n Cloud</th>
                                <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">自托管版</th>
                            </tr>
                        </thead>
                        <tbody class="bg-white divide-y divide-gray-200">
                            <tr class="hover:bg-gray-50">
                                <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">安装复杂度</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check-circle text-green-500 mr-1"></i> 无需安装</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-cog text-blue-500 mr-1"></i> 需要技术知识</td>
                            </tr>
                            <tr class="hover:bg-gray-50">
                                <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">费用</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-dollar-sign text-yellow-500 mr-1"></i> 免费试用，付费计划</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check-circle text-green-500 mr-1"></i> 完全免费</td>
                            </tr>
                            <tr class="hover:bg-gray-50">
                                <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">数据控制</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-lock text-gray-500 mr-1"></i> 数据存储在云端</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-database text-green-500 mr-1"></i> 完全掌控数据</td>
                            </tr>
                            <tr class="hover:bg-gray-50">
                                <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">维护</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-check-circle text-green-500 mr-1"></i> 无需维护</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><i class="fas fa-tools text-blue-500 mr-1"></i> 需要自行维护</td>
                            </tr>
                            <tr class="hover:bg-gray-50">
                                <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">适合人群</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">初学者/非技术用户</td>
                                <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">开发者/技术团队</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </section>

        <!-- FAQ Section -->
        <section class="mb-12">
            <h2 class="text-3xl font-bold mb-6 text-gray-800 border-b pb-2">
                <i class="fas fa-question-circle text-blue-500 mr-3"></i>常见问题与注意事项
            </h2>

            <div class="space-y-6">
                <div class="bg-white p-6 rounded-xl shadow-md">
                    <h3 class="text-xl font-semibold text-gray-800 mb-3">如何选择 Cloud 或自托管？</h3>
                    <ul class="text-gray-700 space-y-2">
                        <li><strong>n8n Cloud</strong>：适合新手或不想管理服务器的用户，快速上手但功能受免费试用限制</li>
                        <li><strong>自托管</strong>：适合有技术能力的用户，免费且可完全控制，但需要配置服务器和维护</li>
                    </ul>
                </div>

                <div class="bg-white p-6 rounded-xl shadow-md">
                    <h3 class="text-xl font-semibold text-gray-800 mb-3">如何确保数据安全？</h3>
                    <ul class="text-gray-700 space-y-2">
                        <li>自托管时，建议配置 SSL（参考 <a href="https://docs.n8n.io/hosting/security/ssl/" class="text-blue-600 hover:underline" target="_blank">https://docs.n8n.io/hosting/security/ssl/</a>）</li>
                        <li>使用强密码保护管理员账户</li>
                        <li>定期备份 <code>n8n_data</code> 卷或数据库</li>
                    </ul>
                </div>

                <div class="bg-white p-6 rounded-xl shadow-md">
                    <h3 class="text-xl font-semibold text-gray-800 mb-3">如何解决安装问题？</h3>
                    <ul class="text-gray-700 space-y-2">
                        <li>检查 Docker/Node.js 版本是否符合要求</li>
                        <li>查看 n8n 官方论坛（<a href="https://community.n8n.io" class="text-blue-600 hover:underline" target="_blank">https://community.n8n.io</a>）或文档（<a href="https://docs.n8n.io" class="text-blue-600 hover:underline" target="_blank">https://docs.n8n.io</a>）</li>
                        <li>常见问题如端口冲突，可尝试更改 <code>-p 5678:5678</code> 为其他端口（如 <code>-p 8080:5678</code>）</li>
                    </ul>
                </div>

                <div class="bg-white p-6 rounded-xl shadow-md">
                    <h3 class="text-xl font-semibold text-gray-800 mb-3">如何开始创建工作流？</h3>
                    <ul class="text-gray-700 space-y-2">
                        <li>登录 n8n 后，参考官方快速入门指南（<a href="https://docs.n8n.io/getting-started/quickstart/" class="text-blue-600 hover:underline" target="_blank">https://docs.n8n.io/getting-started/quickstart/</a>）</li>
                        <li>尝试社区模板（<a href="https://n8n.io/workflows" class="text-blue-600 hover:underline" target="_blank">https://n8n.io/workflows</a>）快速上手</li>
                    </ul>
                </div>
            </div>
        </section>
    </div>

    <script>
        // Initialize Mermaid
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });

        // Copy code block function
        function copyCode(button) {
            const codeBlock = button.parentNode.querySelector('code');
            const range = document.createRange();
            range.selectNode(codeBlock);
            window.getSelection().removeAllRanges();
            window.getSelection().addRange(range);
            document.execCommand('copy');
            window.getSelection().removeAllRanges();
            
            // Change button icon temporarily
            const icon = button.querySelector('i');
            const originalIcon = icon.className;
            icon.className = 'fas fa-check';
            setTimeout(() => {
                icon.className = originalIcon;
            }, 1000);
        }

        // Tab switching functionality
        const tabs = document.querySelectorAll('.flex.border-b button');
        tabs.forEach(tab => {
            tab.addEventListener('click', () => {
                tabs.forEach(t => t.classList.remove('tab-active'));
                tab.classList.add('tab-active');
            });
        });
    </script>
</body>
</html>
```